//1，引入路由

import {createRouter, createWebHistory} from "vue-router";
import Login from "@/components/Login.vue";
import NotFound from "@/components/notFound.vue";
import Main from "@/components/Main.vue";
import Register from "@/components/Register.vue";



//创建路由实例 并接收
let router=createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:"/",
            component:Login
        },
        {
            path:"/login",
            component:Login
        },
        {
            path:"/main",
            name:'main',
            component:Main
        },
        {
            path:"/register",
            name:'register',
            component:Register
        },
        {
            path:"/:pathMatch(.*)*",
            component:NotFound
        }
    ]
})

//暴露路由对象
export default router;